<template>
	<div>
		<el-row class="bg">
			<el-col :span="24">
				<el-form :inline="true" :model="dataForm" ref="dataForm" @keyup.enter.native="init()">
					<el-form-item label="门控单元编号：">
						<el-select v-model="dataForm.DCU" placeholder="请选择DCU编号" @change="getdoorChange">
							<!-- <el-checkbox v-model="checkOptions.checkAll" :style="{padding:'5px 20px'}"
																:indeterminate="checkOptions.isIndeterminate"
																@change="handleCheckAllChange">
																全选
															</el-checkbox> -->
							<el-option v-for="item in DCUoptions" :key="item.dcu" :label="item.dcu" :value="item.dcu">
							</el-option>
						</el-select>
					</el-form-item>
					<!-- <el-form-item>
						<el-button @click="init()" type="primary" class="search">搜索</el-button>
					</el-form-item> -->
					<!-- <el-form-item>
						<el-button type="info" class="reset" @click="reset">重置</el-button>
					</el-form-item> -->
					<el-form-item class="baseInfoBtnRight">
						<!-- <el-button type="primary" v-if="type==2" @click="leftDCU">单独读左</el-button>
						<el-button type="primary" v-if="type==2" @click="rightDCU">单独读右</el-button> -->
						<el-button class="baseInfoBtn1" type="primary" @click="readDCUNew">读取
						</el-button>
					</el-form-item>
					<el-form-item class="baseInfoBtnRight">
						<el-button class="baseInfoBtn5" type="primary" @click="whiteDCUNew">写入</el-button>
					</el-form-item>
					<el-form-item class="baseInfoBtnRight">
						<el-button class="baseInfoBtn5" type="primary" @click="LoadNew">加载</el-button>
					</el-form-item>
					<el-form-item class="baseInfoBtnRight">
						<el-button class="baseInfoBtn3" type="primary" @click="saveNew">保存</el-button>
					</el-form-item>
					<el-form-item class="baseInfoBtnRight">
						<el-button class="btn4" type="primary" @click="exportHandle()">导出所有数据</el-button>
					</el-form-item>
				</el-form>
			</el-col>
		</el-row>
		<el-row class="bg1">
			<el-col :span="24">
				<h3 class="baseHeader" style="text-align: left">DCU参数</h3>
				<div style="display: flex;">
					<div class="baseInfo" style="width: 100%;">
						<!-- <div class="homeTuTxt">基础参数</div> -->
						<div class="baseInfoContent">
							<el-form :inline="true" :model="baseForm">
								<el-row>
									<div class="baseInfo1">
										<el-form-item label="左门机阻力：">
											<el-input-number v-model="baseForm.leftNowel"
												oninput="value=value.replace(/[^\d]/g,'')" :readonly="DCUStatus"
												placeholder="" clearable type="number" :min='0' :max='150' :step='1'
												style="width: 7.8vw; height: 3.5vh; min-height: 30px"></el-input-number>
										</el-form-item>
										<span class="company">N</span>
										<span class="company" style="padding-left: 10px;">(0~150N)</span>
									</div>
									<div class="baseInfo1">
										<el-form-item label="右门机阻力：">
											<el-input-number v-model="baseForm.rightNowel"
												oninput="value=value.replace(/[^\d]/g,'')" :readonly="DCUStatus"
												placeholder="" clearable :min='0' :max='150' :step='1'
												style="width: 7.8vw; height: 3.5vh; min-height: 30px"></el-input-number>
										</el-form-item>
										<span class="company">N</span>
										<span class="company" style="padding-left: 10px;">(0~150N)</span>
									</div>
								</el-row>
								<el-row>
									<div class="baseInfo1">
										<el-form-item label="关门到位撞击力：">
											<el-input-number v-model="baseForm.closeImpact"
												oninput="value=value.replace(/[^\d]/g,'')" :readonly="DCUStatus"
												placeholder="" clearable :min='0' :max='300' :step='1'
												style="width: 7.8vw; height: 3.5vh; min-height: 30px"></el-input-number>
										</el-form-item>
										<el-form-item label="" v-if="type == 2">
											<el-input v-model="baseForm.closeImpactRight"
												oninput="value=value.replace(/[^\d]/g,'')" :readonly="DCUStatus"
												placeholder="" clearable
												style="width: 7.8vw; height: 3.5vh; min-height: 30px"></el-input>
										</el-form-item>
										<span class="company">N</span>
										<span class="company" style="padding-left: 10px;">(0~300N)</span>
									</div>
									<div class="baseInfo1">
										<el-form-item label="开门到位撞击力：">
											<el-input-number v-model="baseForm.openImpact"
												oninput="value=value.replace(/[^\d]/g,'')" :readonly="DCUStatus"
												placeholder="" clearable :min='0' :max='300' :step='1'
												style="width: 7.8vw; height: 3.5vh; min-height: 30px"></el-input-number>
										</el-form-item>
										<el-form-item label="" v-if="type == 2">
											<el-input v-model="baseForm.openImpactRight"
												oninput="value=value.replace(/[^\d]/g,'')" :readonly="DCUStatus"
												placeholder="" clearable
												style="width: 7.8vw; height: 3.5vh; min-height: 30px"></el-input>
										</el-form-item>
										<span class="company">N</span>
										<span class="company" style="padding-left: 10px;">(0~300N)</span>
									</div>
								</el-row>
								<el-row>
									<div class="baseInfo1">
										<el-form-item label="遇障力：">
											<el-input-number v-model="baseForm.encounterNowel"
												oninput="value=value.replace(/[^\d]/g,'')" :readonly="DCUStatus"
												placeholder="" clearable :min='0' :max='150' :step='1'
												style="width: 7.8vw; height: 3.5vh; min-height: 30px"></el-input-number>
										</el-form-item>
										<el-form-item label="" v-if="type == 2">
											<el-input v-model="baseForm.encounterNowelRight"
												oninput="value=value.replace(/[^\d]/g,'')" :readonly="DCUStatus"
												placeholder="" clearable
												style="width: 7.8vw; height: 3.5vh; min-height: 30px"></el-input>
										</el-form-item>
										<span class="company">N</span>
										<span class="company" style="padding-left: 10px;">(0~150N)</span>
									</div>
									<div class="baseInfo1">
										<el-form-item label="遇障回退距离：">
											<el-input-number v-model="baseForm.encounterRegressionDistance"
												oninput="value=value.replace(/[^\d]/g,'')" :readonly="DCUStatus"
												placeholder="" clearable :min='0' :max='10' :step='1'
												style="width: 7.8vw; height: 3.5vh; min-height: 30px"></el-input-number>
										</el-form-item>
										<el-form-item label="" v-if="type == 2">
											<el-input v-model="baseForm.encounterRegressionDistanceRight"
												oninput="value=value.replace(/[^\d]/g,'')" :readonly="DCUStatus"
												placeholder="" clearable
												style="width: 7.8vw; height: 3.5vh; min-height: 30px"></el-input>
										</el-form-item>
										<span class="company">mm</span>
										<span class="company" style="padding-left: 10px;">(0~10mm)</span>
									</div>
								</el-row>
								<el-row>
									<div class="baseInfo1">
										<el-form-item label="关门遇障次数：">
											<el-input-number v-model="baseForm.closeEncounterNum" :readonly="DCUStatus"
												oninput="value=value.replace(/[^\d]/g,'')" placeholder="" clearable
												:min='1' :max='5' :step='1'
												style="width: 7.8vw; height: 3.5vh; min-height: 30px"></el-input-number>
										</el-form-item>
										<el-form-item label="" v-if="type == 2">
											<el-input v-model="baseForm.closeEncounterNumRight" :readonly="DCUStatus"
												oninput="value=value.replace(/[^\d]/g,'')" placeholder="" clearable
												style="width: 7.8vw; height: 3.5vh; min-height: 30px"></el-input>
										</el-form-item>
										<span class="company">次</span>
										<span class="company" style="padding-left: 10px;">(1-5次)</span>
									</div>
									<div class="baseInfo1">
										<el-form-item label="开门遇障次数：">
											<el-input-number v-model="baseForm.openEncounterNum" :readonly="DCUStatus"
												:min='1' :max='5' :step='1' oninput="value=value.replace(/[^\d]/g,'')"
												placeholder="" clearable
												style="width: 7.8vw; height: 3.5vh; min-height: 30px"></el-input-number>
										</el-form-item>
										<el-form-item label="" v-if="type == 2">
											<el-input v-model="baseForm.openEncounterNumRight" :readonly="DCUStatus"
												oninput="value=value.replace(/[^\d]/g,'')" placeholder="" clearable
												style="width: 7.8vw; height: 3.5vh; min-height: 30px"></el-input>
										</el-form-item>
										<span class="company">次</span>
										<span class="company" style="padding-left: 10px;">(1-5次)</span>
									</div>
								</el-row>
								<el-row>
									<div class="baseInfo1">
										<el-form-item label="关门遇障等待时间：">
											<el-input v-model="baseForm.closeEncounterTime" :readonly="DCUStatus"
												oninput="value=value.replace(/[^\d]/g,'')" placeholder="" clearable
												style="width: 7.8vw; height: 3.5vh; min-height: 30px"></el-input>
										</el-form-item>
										<el-form-item label="" v-if="type == 2">
											<el-input v-model="baseForm.closeEncounterTimeRight" :readonly="DCUStatus"
												oninput="value=value.replace(/[^\d]/g,'')" placeholder="" clearable
												style="width: 7.8vw; height: 3.5vh; min-height: 30px"></el-input>
										</el-form-item>
										<span class="company">s</span>
										<span class="company" style="padding-left: 10px;">(1-10s)</span>
									</div>
									<div class="baseInfo1">
										<el-form-item label="开门遇障等待时间：">
											<el-input v-model="baseForm.openEncounterTime" :readonly="DCUStatus"
												oninput="value=value.replace(/[^\d]/g,'')" placeholder="" clearable
												style="width: 7.8vw; height: 3.5vh; min-height: 30px"></el-input>
										</el-form-item>
										<el-form-item label="" v-if="type == 2">
											<el-input v-model="baseForm.openEncounterTimeRight" :readonly="DCUStatus"
												oninput="value=value.replace(/[^\d]/g,'')" placeholder="" clearable
												style="width: 7.8vw; height: 3.5vh; min-height: 30px"></el-input>
										</el-form-item>
										<span class="company">s</span>
										<span class="company" style="padding-left: 10px;">(1-10s)</span>
									</div>
								</el-row>
								<el-row>
									<div class="baseInfo1">
										<el-form-item label="蜂鸣器音量：">
											<el-input v-model="baseForm.buzzerGearSetting" :readonly="DCUStatus"
												oninput="value=value.replace(/[^\d]/g,'')" placeholder="" clearable
												style="width: 7.8vw; height: 3.5vh; min-height: 30px"></el-input>
										</el-form-item>
										<span class="company">档位</span>
										<span class="company" style="padding-left: 10px;">(1-3档)</span>
									</div>
									<div class="baseInfo1">
										<el-form-item label="手解重关时间：">
											<el-input v-model="baseForm.macloseTime" :readonly="DCUStatus"
												oninput="value=value.replace(/[^\d]/g,'')" placeholder="" clearable
												style="width: 7.8vw; height: 3.5vh"></el-input>
										</el-form-item>
										<el-form-item label="" v-if="type == 2">
											<el-input v-model="baseForm.macloseTimeRigth" :readonly="DCUStatus"
												oninput="value=value.replace(/[^\d]/g,'')" placeholder="" clearable
												style="width: 7.8vw; height: 3.5vh"></el-input>
										</el-form-item>
										<span class="company">s</span>
										<span class="company" style="padding-left: 10px;">(1-20s)</span>
									</div>
								</el-row>
								<el-row>
									<div class="baseInfo1">
										<el-form-item label="过流保护阈值：">
											<el-input v-model="baseForm.overProThre" :readonly="DCUStatus"
												placeholder="" step="0.1" type="number" clearable
												style="width: 7.8vw; height: 3.5vh"></el-input>
										</el-form-item>
										<el-form-item label="" v-if="type == 2">
											<el-input v-model="baseForm.overProThreRight" :readonly="DCUStatus"
												placeholder="" clearable style="width: 7.8vw; height: 3.5vh"></el-input>
										</el-form-item>
										<span class="company">A</span>
										<span class="company" style="padding-left: 10px;">(0-150A)</span>
									</div>
									<div class="baseInfo1">
										<el-form-item label="端门报警时间：">
											<el-input v-model="baseForm.endAlarmTime" :readonly="DCUStatus"
												placeholder="" oninput="value=value.replace(/[^\d]/g,'')" clearable
												style="width: 7.8vw; height: 3.5vh"></el-input>
										</el-form-item>
										<el-form-item label="" v-if="type == 2">
											<el-input v-model="baseForm.endAlarmTimeRight" :readonly="DCUStatus"
												placeholder="" clearable style="width: 7.8vw; height: 3.5vh"></el-input>
										</el-form-item>
										<span class="company">s</span>
										<span class="company" style="padding-left: 10px;">(1-20s)</span>
									</div>
								</el-row>
								<el-row>
									<div class="baseInfo1">
										<el-form-item label="电磁锁档位：">
											<el-input v-model="baseForm.elockGearSetting" :readonly="DCUStatus"
												oninput="value=value.replace(/[^\d]/g,'')" clearable
												style="width: 7.8vw; height: 3.5vh"></el-input>
										</el-form-item>
										<el-form-item label="" v-if="type == 2">
											<el-input v-model="baseForm.elockGearSettingRight" :readonly="DCUStatus"
												oninput="value=value.replace(/[^\d]/g,'')" clearable
												style="width: 7.8vw; height: 3.5vh"></el-input>
										</el-form-item>
										<span class="company">档位</span>
										<span class="company" style="padding-left: 10px;">(1-3档)</span>
									</div>
									<div class="baseInfo1">
										<el-form-item label="是否有应急门：">
											<span v-if="baseForm.isHaveEmergencyDoor==1">是</span>
											<span v-else>否</span>
										</el-form-item>
										<el-form-item label="" v-if="type == 2">
											<el-input v-model="baseForm.isHaveEmergencyDoor" :readonly="DCUStatus"
												oninput="value=value.replace(/[^\d]/g,'')" clearable
												style="width: 7.8vw; height: 3.5vh"></el-input>
										</el-form-item>
									</div>
									<!-- <div class="baseInfo1">
										<el-form-item label="死区时间：">
											<el-input v-model="baseForm.deadZone" :readonly="DCUStatus"
												oninput="value=value.replace(/[^\d]/g,'')" clearable
												style="width: 7.8vw; height: 3.5vh"></el-input>
										</el-form-item>
										<el-form-item label="" v-if="type == 2">
											<el-input v-model="baseForm.deadZoneRight" :readonly="DCUStatus"
												oninput="value=value.replace(/[^\d]/g,'')" clearable
												style="width: 7.8vw; height: 3.5vh"></el-input>
										</el-form-item>
										<span class="company">us</span>
									</div> -->
								</el-row>
							</el-form>
						</div>
					</div>
					<div class="baseInfo baseInfozd" style="display: none;">
						<!-- width: 29%;margin-left: 1%; -->
						<div class="homeTuTxt" style="line-height: 20px; width: 50px">
							只读参数
						</div>
						<div class="baseInfoContent operIndexDiv" style="padding-left: 0px;margin-left: 26%;">
							<el-form :inline="true" :model="baseForm1">
								<el-row>
									<div class="baseInfo1" style="width: 100%;">
										<el-form-item label="上电累计开门次数：" :class="leftStatus ? 'leftColor' : ''">
											<el-input v-model="baseForm1.openNum" :readonly="true" placeholder=""
												clearable style="width: 7.8vw; height: 3.5vh"></el-input>
										</el-form-item>
										<el-form-item label="" v-if="type == 2" :class="rightStatus ? 'leftColor' : ''">
											<el-input v-model="baseForm1.openNumRight" :readonly="true" placeholder=""
												clearable style="width: 7.8vw; height: 3.5vh"></el-input>
										</el-form-item>
									</div>

								</el-row>
								<el-row>
									<div class="baseInfo1" style="width: 100%;">
										<el-form-item label="上电累计运行小时：" :class="leftStatus ? 'leftColor' : ''">
											<el-input v-model="baseForm1.runningHour" :readonly="true" placeholder=""
												clearable style="width: 7.8vw; height: 3.5vh"></el-input>
										</el-form-item>
										<el-form-item label="" v-if="type == 2" :class="rightStatus ? 'leftColor' : ''">
											<el-input v-model="baseForm1.runningHourRight" :readonly="true"
												placeholder="" clearable style="width: 7.8vw; height: 3.5vh"></el-input>
										</el-form-item>
									</div>
								</el-row>
								<el-row>
									<div class="baseInfo1" style="width: 100%;">
										<el-form-item label="上电累计遇阻次数：" :class="leftStatus ? 'leftColor' : ''">
											<el-input v-model="baseForm1.encounterNum" :readonly="true" placeholder=""
												clearable style="width: 7.8vw; height: 3.5vh"></el-input>
										</el-form-item>
										<el-form-item label="" v-if="type == 2" :class="rightStatus ? 'leftColor' : ''">
											<el-input v-model="baseForm1.encounterNumRight" :readonly="true"
												placeholder="" clearable style="width: 7.8vw; height: 3.5vh"></el-input>
										</el-form-item>
									</div>
								</el-row>
								<el-row>
									<div class="baseInfo1" style="width: 100%;">
										<el-form-item label="上电累计启动次数：" :class="leftStatus ? 'leftColor' : ''">
											<el-input v-model="baseForm1.startNum" :readonly="true" placeholder=""
												clearable style="width: 7.8vw; height: 3.5vh"></el-input>
										</el-form-item>
										<el-form-item label="" v-if="type == 2" :class="rightStatus ? 'leftColor' : ''">
											<el-input v-model="baseForm1.startNumRight" :readonly="true" placeholder=""
												clearable style="width: 7.8vw; height: 3.5vh"></el-input>
										</el-form-item>
									</div>
								</el-row>
							</el-form>
						</div>
					</div>

				</div>
			</el-col>
		</el-row>
		<el-row class="">
			<el-col :span="12" class="cure">
				<h5 class="baseHeader" style="text-align: left;font-size: 16px;">
					开门速度曲线及动能曲线实时参数
					<div class="chartbase">
						<el-select v-model="velocityCurveOpen" placeholder="请选择曲线类型" @change="CurveChange(0)">
							<el-option v-for="item in velocityCurveList" :key="item.id" :label="item.name"
								:value="item.id">
							</el-option>
						</el-select>
						<el-select v-if="velocityCurveOpen==1" v-model="velocityCurveTime" placeholder="请选择曲线开始时间"
							@change="CurveTimeChange(0)" style="margin-left: 10px;">
							<el-option v-for="(item,index) in CurveTimeList" :key="index" :label="item.name"
								:value="item.id">
							</el-option>
						</el-select>
					</div>

				</h5>

				<div style="display: flex; width: 100%;height: 100%;">
					<div class="baseInfoEcharts">
						<!-- @dblclick="echarts(0)" -->
						<div id="baseEcharts" style="width: 100%; height:85%"></div>
					</div>
				</div>

			</el-col>
			<el-col :span="12" class="cure cure1">
				<h5 class="baseHeader" style="text-align: left;font-size: 16px;">
					关门速度曲线及动能曲线实时参数
					<div class="chartbase">
						<el-select v-model="velocityCurveClose" placeholder="请选择曲线类型" @change="CurveChange(1)">
							<el-option v-for="item in velocityCurveList" :key="item.id" :label="item.name"
								:value="item.id">
							</el-option>
						</el-select>
						<el-select v-if="velocityCurveClose==1" v-model="velocityCurveTime1" placeholder="请选择曲线开始时间"
							@change="CurveTimeChange(1)" style="margin-left: 10px;">
							<el-option v-for="(item,index) in CurveTimeListClose" :key="index" :label="item.name"
								:value="item.id">
							</el-option>
						</el-select>
					</div>
				</h5>
				<div style="display: flex; width: 100%;height: 100%;">
					<div class="baseInfoEcharts">
						<!-- @dblclick="echarts(1)" -->
						<div id="baseEchartsClose" style="width: 100%; height:85%"></div>
					</div>
				</div>
			</el-col>
		</el-row>
		<oper-data v-if="operdataVisible" ref="operdataFrom" @refreshDataList="init"></oper-data>
		<history-or-update v-if="historyVisible" ref="historyForm" @refreshDataList="init" @getHistory="getHistory">
		</history-or-update>
		<el-dialog :visible.sync="saveVisible" title="DCU数据保存" :close-on-click-modal="false"
			:close-on-press-escape="false">
			<el-form :model="saveForm" ref="saveForm" :rules="saveRule" @keyup.enter.native="confirm()"
				label-width="200px">
				<el-form-item prop="name" label="DCU数据保存名称">
					<el-input v-model="saveForm.name" placeholder="DCU数据保存名称"></el-input>
				</el-form-item>
			</el-form>
			<template slot="footer">
				<el-button @click="saveVisible = false">{{ $t("cancel") }}</el-button>
				<el-button type="primary" @click="confirm()">{{
          $t("confirm")
        }}</el-button>
			</template>
		</el-dialog>
	</div>
</template>

<script>
	import debounce from "lodash/debounce";
	import * as echarts from "echarts";
	import utils from "@/utils/utils";
	import Cookies from "js-cookie";
	import AddOrUpdate from "./oper-add-or-update.vue";
	import SaveOrUpdate from "./save-or-update.vue";
	import operData from "./oper-data.vue";
	import historyOrUpdate from "./oper-add-or-update.vue";
	export default {
		components: {
			AddOrUpdate,
			SaveOrUpdate,
			operData,
			historyOrUpdate,
		},
		data() {
			return {
				dataForm: {
					stationSide: 1,
					DCU: "",
					CPU: "",
				},
				options: utils.StationList,
				DCUoptions: [],
				CPUoptions: utils.cpuType,
				DCUStatus: false,
				saveVisible: false, //保存名字
				baseForm: {
					leftNowel: "", //门机阻力
					rightNowel: "", //门机阻力
					closeImpact: "", //关门到位撞击力
					// closeImpactRight: '', //关门到位撞击力
					openImpact: "", //开门到位撞击力
					// openImpactRight: '', //开门到位撞击力
					encounterNowel: "", //遇障力
					// encounterNowelRight: '', //遇障力
					encounterRegressionDistance: "", //遇障回退距离
					// encounterRegressionDistanceRight: '', //遇障回退距离
					closeEncounterNum: "", //关门遇障次数
					// closeEncounterNumRight: '', //关门遇障次数
					openEncounterNum: "", //开门遇障次数
					// openEncounterNumRight: '', //开门遇障次数
					closeEncounterTime: "", //关门遇障等待时间
					// closeEncounterTimeRight: '', //关门遇障等待时间
					openEncounterTime: "", //开门遇障等待时间
					// openEncounterTimeRight: '', //开门遇障等待时间
					buzzerGearSetting: "", //蜂鸣器音量
					macloseTime: "", //手解重关时间
					// macloseTimeRigth: '', //手解重关时间
					overProThre: "", //过流保护阈值
					// overProThreRight: '', //过流保护阈值
					endAlarmTime: "", //端门报警时间
					// endAlarmTimeRight: '', //端门报警时间
					elockGearSetting: "", //电磁锁档位
					// elockGearSettingRight:'',//电磁锁档位
					deadZone: "", //死区时间
					isHaveEmergencyDoor: ''
					// deadZoneRight:'',//死区时间
				},
				baseForm1: {
					openNum: "", //上电累计开门次数
					// openNumRight: '', //上电累计开门次数
					runningHour: "", //上电累计运行小时
					// runningHourRight: '', //上电累计运行小时
					encounterNum: "", //上电累计遇阻次数
					// encounterNumRight: '', //上电累计遇阻次数
					startNum: "", //上电累计启动次数
					// startNumRight: '', //上电累计启动次数
				},
				type: Cookies.get("type"), //Cookies.get('type')
				leftStatus: false,
				rightStatus: false,
				num: 0,
				dataX: [],
				dataY: [],
				dataYD: [],
				dataX1: [],
				dataY1: [],
				dataYD1: [],
				addOrUpdateVisible: false,
				saveOrUpdateVisible: false, //名字保存
				operdataVisible: false,
				historyVisible: false,
				checkOptions: {
					isIndeterminate: false,
					checkAll: false,
				},
				saveForm: {
					name: "",
				},
				activeIndex: "",
				readDataStatus: false,
				velocityCurveOpen: 0,
				velocityCurveClose: 0,
				velocityCurveTime: "",
				velocityCurveTime1: "",
				velocityCurveList: [{
						id: 0,
						name: '实时曲线'
					},
					{
						id: 1,
						name: "64条曲线"
					}
				],
				CurveTimeList: [],
				CurveTimeListClose: [],
				curve64Status: false,
				curve64StatusClose: false,
				openchart: '', //开门速度曲线
				closechart: '', //关门速度曲线
				stepUp: '', //上行step值
				stepDown: '', //下行step值
				stationSide: '', //选中门的上下行
			};
		},
		mounted() {
			window.addEventListener('onmessageWSDCU', this.getSocketDataDCU)
		},
		destroyed() {
			window.removeEventListener('onmessageWSDCU', this.getSocketDataDCU)
		},
		computed: {
			saveRule() {
				return {
					name: [{
						required: true,
						message: "DCU数据保存名称不能为空",
						trigger: "blur",
					}, ],
				};
			},
		},
		activated() {
			this.init();
		},
		watch: {
			"baseForm.buzzerGearSetting": {
				handler(val) {
					// console.log(this.readDataStatus, '写入')
					if (val > 3 && this.readDataStatus) {
						this.baseForm.buzzerGearSetting = "";
						return this.$message.error("蜂鸣器音量不能大于三档");
					}
				},
				deep: true,
				immediate: true,
			},
			"baseForm.elockGearSetting": {
				handler(val) {
					if (val > 3 && this.readDataStatus) {
						this.baseForm.elockGearSetting = "";
						return this.$message.error("电磁锁档位上不能大于三档");
					}
				},
				deep: true,
				immediate: true,
			},
		},
		methods: {
			getSocketDataDCU(res) {
				console.log(res, '运行参数返回的值')
				if (res.detail.data) {
					this.init()
				}
			},
			init(val) {
				console.log(val, '数据显示')
				// this.dataForm.DCU = ''
				//获取门的信息
				var p0 = new Promise((resolve, reject) => {
					this.getdoorList(() => {
						resolve();
					});
				});
				Promise.all([p0]).then(() => {
					console.log(val, '数据显示')
					this.num = 0;
					this.dataX = [0];
					this.dataY = [0];
					this.dataYD = [0];
					this.dataX1 = [0];
					this.dataY1 = [0];
					this.dataYD1 = [0];
					//切换实时数据
					if (val == 0) {
						this.initEcharts();
					}
					if (val == 1) {
						this.initEchartsClose();
					}
					if (val == undefined) {
						this.initEcharts();
						this.initEchartsClose();
					}
					this.handleMsg();
					// this.getDCUCS()
					// this.initEcharts()
				});
			},
			// 多选
			handleCheckAllChange(e) {
				this.dataForm.DCU = e ? this.DCUoptions.map((item) => item.dcu) : [];
				this.checkOptions.isIndeterminate = false;
			},
			//接收websocket数据
			handleMsg() {
				this.$globalWebSocket.ws1.send("DCU");
				this.$globalWebSocket.ws1.onmessage = this.getMessage;
			},
			//获取websocket数据
			getMessage(e) {
				var data = JSON.parse(e.data);
				if (data.dcuHeartBeatCurve && data.dcuHeartBeatCurve.dcuId !== 0) {
					var message = data.dcuHeartBeatCurve
					// 上下行的选择
					if (this.stationSide == 1) {
						var doorID = Number(this.dataForm.DCU) - this.stepUp
					}
					if (this.stationSide == 0) {
						var doorID = Number(this.dataForm.DCU) - this.stepDown + 128
					}
					// 上下行的选择
					if (doorID == data.dcuId && this.dataForm.DCU !== 0) {
						this.getDataFour(message);
					}
					if (doorID == data.dcuId && message.openClose == 1 && !this.curve64Status) { //开门速度曲线
						this.getCureSpeed(message, data.curTime)
						this.refreshData(this.dataX, this.dataYD, this.dataY, 0);
					} else if (doorID == data.dcuId && message.openClose == 3 && !this.curve64StatusClose) { //关门速度曲线
						this.getCureSpeedClose(message, data.curTime)
						this.refreshData(this.dataX1, this.dataYD1, this.dataY1, 1);
					} else {
						this.dataX = [0];
						this.dataY = [0];
						this.dataYD = [0];
						this.dataX1 = [0];
						this.dataY1 = [0];
						this.dataYD1 = [0];
						this.refreshData(this.dataX, this.dataYD, this.dataY, 0);
						this.refreshData(this.dataX1, this.dataYD1, this.dataY1, 1);
					}
				}
			},
			getdoorChange(val) {
				if (val == '') {
					this.dataX = [0];
					this.dataY = [0];
					this.dataYD = [0];
					this.dataX1 = [0];
					this.dataY1 = [0];
					this.dataYD1 = [0];
					this.refreshData(this.dataX, this.dataYD, this.dataY, 0);
					this.refreshData(this.dataX1, this.dataYD1, this.dataY1, 1);
				}
				this.DCUoptions.forEach((item, index) => {
					if (item.dcu == this.dataForm.DCU) {
						if (index > 40) {
							this.activeIndex = this.dataForm.DCU - 100; //当前选中的DCUIndex
						} else {
							this.activeIndex = index; //当前选中的DCUIndex
						}
						this.stationSide = item.stationSide
					}
				});
				console.log(this.activeIndex, this.stationSide, '选中的index值')
			},
			// 新增毫秒相加
			getnewSeconds(val, tep) {
				var newTime = new Date(val + tep * 1000); //根据时间戳和秒相加得到最新的时间戳

				return this.filterTime(newTime);
			},
			//DCU编号数组
			getdoorList(callback) {
				this.DCUoptions = [];
				this.$http.get("/psc/door/getDoor").then((res) => {
					this.DCUoptions = [];
					this.DCUoptions = res.data.data.up.concat(res.data.data.down);
					// 2023年5月26日开始
					this.stepUp = Number(res.data.data.up[1].dcu) - 1
					this.stepDown = Number(res.data.data.down[res.data.data.down.length - 2].dcu) - 1
					// 2023年5月26日结束
					console.log(this.stepUp, this.stepDown, '上下行的step值')
					for (var i = 0; i < this.DCUoptions.length; i++) {
						if (
							this.DCUoptions[i].doorType === 0 ||
							this.DCUoptions[i].doorType === 2
						) {
							this.DCUoptions.splice(i, 1); // 将使后面的元素依次前移，数组长度减1
							i--; // 如果不减，将漏掉一个元素
						}
					}
					if (callback) {
						callback();
					}
				});
			},
			//读取DCU最新版
			readDCUNew: debounce(
				function() {
					//去读取
					this.readDataStatus = false
					// this.DCUoptions.forEach((item, index) => {
					// 	if(index>40){
					// 		this.activeIndex = this.dataForm.DCU - 100; //当前选中的DCUIndex
					// 	}else{
					// 		this.activeIndex = index; //当前选中的DCUIndex
					// 	}
					// });
					this.getDCUCS();
				},
				500, {
					leading: true,
					trailing: false,
				}
			),
			//获取DCU初始值
			getDCUCS() {
				this.$http
					.get("/psc/dcu/readCurrentDcu/" + this.returnDoorId())
					.then((res) => {
						if (res.data.code !== 0) {
							this.returnObj();
							return this.$message.error(res.data.msg);
						}
						if (res.data.code == 0 && res.data.data !== null) {
							this.getData(res.data.data);
						}

					});
			},
			//写入DCU最新版
			whiteDCUNew: debounce(
				function() {
					this.$confirm('此操作将写入DCU参数, 是否继续?', '提示', {
						confirmButtonText: '确定',
						cancelButtonText: '取消',
						type: 'warning'
					}).then(() => {
						if (this.dataForm.DCU.length !== 0) {
							this.readDataStatus = true
							if (this.baseForm.buzzerGearSetting > 3 || this.baseForm.elockGearSetting > 3) {
								this.baseForm.buzzerGearSetting = "";
								this.baseForm.elockGearSetting = "";
								return this.$message.error("蜂鸣器音量和电磁锁档位不能大于三档");
								return false
							}

							var obj = this.paramObj();
							this.$http.post("/psc/dcu/writeDcuParams", obj).then((res) => {
								if (res.data.code !== 0) {
									return this.$message.error(res.data.msg);
								}
								this.$message({
									message: this.$t("prompt.success"),
									type: "success",
									duration: 500,
									onClose: () => {
										this.visible = false;
										this.$emit("refreshDataList");
									},
								});
							});
						} else {
							return this.$message.error("请选择门控单元编号");
						}
					}).catch(() => {
						this.$message({
							type: 'info',
							message: '已取消写入DCU参数'
						});
					});

				},
				500, {
					leading: true,
					trailing: false,
				}
			),
			//保存最新版
			saveNew() {
				if (this.dataForm.DCU.length !== 0) {
					this.saveVisible = true;
					this.$nextTick(() => {
						this.$refs["saveForm"].resetFields();
					});
				} else {
					return this.$message.error("请选择门控单元编号");
				}
			},
			//保存数据确定
			confirm() {
				this.$refs["saveForm"].validate((valid) => {
					if (!valid) {
						return false;
					}
					var obj = this.paramObj();
					obj = {
						name: this.saveForm.name,
						...obj,
					};
					this.$http.post("/psc/dcuparameters", obj).then((res) => {
						if (res.data.code !== 0) {
							return this.$message.error(res.msg);
						}
						this.$message({
							message: this.$t("prompt.success"),
							type: "success",
							duration: 500,
							onClose: () => {
								this.saveVisible = false;
							},
						});
					});
				});
			},
			//加载最新版
			LoadNew() {
				this.historyVisible = true;
				this.$nextTick(() => {
					this.$refs.historyForm.init();
				});
			},
			//获取历史保存的数据
			getHistory(id) {
				// console.log(id, '保存的id值')
				this.$http.get(`/psc/dcuparameters/${id}`).then((res) => {
					if (res.data.code == 0 && res.data.data !== null) {
						this.$nextTick(() => {
							//获取数据
							this.getData(res.data.data);
						});
					}
				});
			},
			//存储数据专用
			paramObj() {
				var arr = [];
				arr.push(this.returnDoorId());
				var obj = {
					dcuArr: arr,
					...this.baseForm,
				};
				// console.log(obj,'数值显示')
				return obj;
			},
			//返回相对应的门的ID
			returnDoorId() {
				var doorNum = "";
				if (this.stationSide == 1) {
					let num1 = Number(this.dataForm.DCU) - this.stepUp;
					doorNum = num1;
				} else if (this.stationSide == 0) {
					let num1 = Number(this.dataForm.DCU) - this.stepDown + 128;
					doorNum = num1;
				}
				// console.log(doorNum,'返回数据')
				return doorNum;
			},

			//获取保存的历史数据
			history() {
				this.addOrUpdateVisible = true;
				this.$nextTick(() => {
					this.$refs.addOrUpdate.init();
				});
			},

			//解析时间戳
			filterTime(time) {
				var date = new Date(time); //时间戳为10位需*1000，时间戳为13位的话不需乘1000
				var h = ''
				var m = ''
				var s = ''
				var Y = date.getFullYear() + "-";
				var M = (date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1) + "-";
				var D = date.getDate() + " ";
				if (date.getHours() < 10) {
					h = '0' + date.getHours() + ":"
				} else {
					h = date.getHours() + ":"
				}
				if (date.getMinutes() < 10) {
					m = '0' + date.getMinutes() + ":"
				} else {
					m = date.getMinutes() + ":";
				}
				if (date.getSeconds() < 10) {
					s = '0' + date.getSeconds() + ":"
				} else {
					s = date.getSeconds() + ":";
				}
				var ms = date.getMilliseconds();
				return Y + M + D + h + m + s + ms;
			},
			//获取基础参数
			getData(val, val1) {
				this.baseForm.leftNowel = val.leftNowel;
				this.baseForm.rightNowel = val.rightNowel;
				this.baseForm.closeImpact = val.closeImpact;
				this.baseForm.openImpact = val.openImpact;
				this.baseForm.encounterNowel = val.encounterNowel;
				this.baseForm.encounterRegressionDistance = val.encounterRegressionDistance;
				this.baseForm.closeEncounterNum = val.closeEncounterNum;
				this.baseForm.openEncounterNum = val.openEncounterNum;
				this.baseForm.closeEncounterTime = val.closeEncounterTime;
				this.baseForm.openEncounterTime = val.openEncounterTime;
				this.baseForm.macloseTime = val.macloseTime;
				this.baseForm.overProThre = val.overProThre;
				this.baseForm.endAlarmTime = val.endAlarmTime;
				this.baseForm.buzzerGearSetting = val.buzzerGearSetting;
				this.baseForm.elockGearSetting = val.elockGearSetting;
				// this.baseForm.deadZone = val.deadZone;
				this.baseForm.isHaveEmergencyDoor = val.isHaveEmergencyDoor
			},
			returnObj() {
				this.baseForm.leftNowel = '';
				this.baseForm.rightNowel = '';
				this.baseForm.closeImpact = '';
				this.baseForm.openImpact = '';
				this.baseForm.encounterNowel = '';
				this.baseForm.encounterRegressionDistance = '';
				this.baseForm.closeEncounterNum = '';
				this.baseForm.openEncounterNum = '';
				this.baseForm.closeEncounterTime = '';
				this.baseForm.openEncounterTime = '';
				this.baseForm.macloseTime = '';
				this.baseForm.overProThre = '';
				this.baseForm.endAlarmTime = '';
				this.baseForm.buzzerGearSetting = '';
				this.baseForm.elockGearSetting = '';
				// this.baseForm.deadZone = val.deadZone;
				this.baseForm.isHaveEmergencyDoor = 0
			},
			getDataFour(val) {
				this.baseForm1.openNum = val.cumulativeOpenTimes;
				this.baseForm1.runningHour = val.cumulativeRunningTimes;
				this.baseForm1.encounterNum = val.cumulativeBlockTimes;
				this.baseForm1.startNum = val.cumulativeStartTimes;
			},
			refreshData(dataX, dataYD, dataY, val) {
				let that = this
				var myChart = ''
				if (val == 0) {
					myChart = that.openchart
					// myChart = this.$echarts.init(document.getElementById("baseEcharts"));

				} else {
					myChart = that.closechart
				}
				var option = myChart.getOption();
				option.xAxis[0].data = dataX;
				option.series[0].data = dataYD;
				option.series[1].data = dataY;
				myChart.setOption(option);
			},
			initEcharts() {
				let that = this
				that.openchart = this.$echarts.init(document.getElementById("baseEcharts"));
				const colorList = ["#F3D024FF", "#2062E6FF"];
				var option = {
					backgroundColor: "#fff",
					title: {
						show: false,
						text: '开门速度曲线及动能曲线实时参数',
						textStyle: {
							color: "rgba(46, 48, 51, 1)",
							fontFamily: 'sans-serif',
							fontSize: '16',
							fontWeight: 'normal',
						}
					},
					legend: {
						icon: "circle",
						top: "0%",
						right: "5%",
						itemWidth: 6,
						itemGap: 20,
						textStyle: {
							color: "#556677",
						},
					},
					tooltip: {
						trigger: "axis",
						axisPointer: {
							label: {
								show: true,
								backgroundColor: "#fff",
								color: "#556677",
								borderColor: "rgba(0,0,0,0)",
								shadowColor: "rgba(0,0,0,0)",
								shadowOffsetY: 0,
							},
							lineStyle: {
								width: 0,
							},
						},
						backgroundColor: "#fff",
						textStyle: {
							color: "#5c6c7c",
						},
						padding: [10, 10],
						extraCssText: "box-shadow: 1px 0 2px 0 rgba(163,163,163,0.5)",
					},
					grid: {
						top: "10%",
						left: "10%",
						right: "10%",
					},
					dataZoom: [{
							// 这个地方是控制下面的滑动条。
							show: true,
							realtime: true,
						},
						{
							type: "inside",
							realtime: true,
							start: 0,
							end: 100,
							xAxisIndex: [0, 1],
						},
					],
					xAxis: [{
						type: "category",
						data: this.dataX,
						axisLine: {
							lineStyle: {
								color: "#DCE2E8",
							},
						},
						axisTick: {
							show: false,
						},
						axisLabel: {
							textStyle: {
								color: "#556677",
							},
							showMinLabel: true,
							showMaxLabel: true,
							// 默认x轴字体大小
							fontSize: 12,
							// margin:文字到x轴的距离
							margin: 15,
						},
						axisPointer: {
							label: {
								// padding: [11, 5, 7],
								padding: [0, 0, 10, 0],
								margin: 15,
								fontSize: 12,
								backgroundColor: {
									type: "linear",
									x: 0,
									y: 0,
									x2: 0,
									y2: 1,
									colorStops: [{
											offset: 0,
											color: "#fff", // 0% 处的颜色
										},
										{
											offset: 0.86,
											color: "#fff", // 0% 处的颜色
										},
										{
											offset: 0.86,
											color: "#33c0cd", // 0% 处的颜色
										},
										{
											offset: 1,
											color: "#33c0cd", // 100% 处的颜色
										},
									],
									global: false, // 缺省为 false
								},
							},
						},
						boundaryGap: false,
					}, ],
					yAxis: [{
							type: "value",
							axisTick: {
								show: false,
							},
							axisLine: {
								show: true,
								lineStyle: {
									color: "#DCE2E8",
								},
							},
							axisLabel: {
								textStyle: {
									color: "#556677",
								},
							},
							splitLine: {
								show: false,
							},
						},
						{
							type: "value",
							position: "right",
							axisTick: {
								show: false,
							},
							axisLabel: {
								textStyle: {
									color: "#556677",
								},
								formatter: "{value}",
							},
							axisLine: {
								show: true,
								lineStyle: {
									color: "#DCE2E8",
								},
							},
							splitLine: {
								show: false,
							},
						},
					],
					series: [{
							name: "动能曲线(J)",
							type: "line",
							data: this.dataYD,
							symbolSize: 1,
							symbol: "circle",
							smooth: true,
							yAxisIndex: 0,
							showSymbol: false,
							lineStyle: {
								width: 5,
								color: colorList[0],
							},
							itemStyle: {
								normal: {
									color: colorList[0],
									borderColor: colorList[0],
								},
							},
						},
						{
							name: "速度曲线(m/s)",
							type: "line",
							data: this.dataY,
							symbolSize: 1,
							symbol: "circle",
							smooth: true,
							yAxisIndex: 1,
							showSymbol: false,
							lineStyle: {
								width: 5,
								color: colorList[1],
							},
							itemStyle: {
								normal: {
									color: colorList[1],
									borderColor: colorList[1],
								},
							},
						},
					],
				};
				that.openchart.setOption(option);
				if (that.openchart) {
					setTimeout(() => {
						that.openchart.resize();
					}, 200)
				}
				window.addEventListener("resize", () => {
					that.openchart.resize();
				});
			},
			initEchartsClose() {
				let that = this
				that.closechart = this.$echarts.init(document.getElementById("baseEchartsClose"));
				const colorList = ["#F3D024FF", "#2062E6FF"];
				var option = {
					backgroundColor: "#fff",
					title: {
						show: false,
						text: '关门速度曲线及动能曲线实时参数',
						textStyle: {
							color: "rgba(46, 48, 51, 1)",
							fontFamily: 'sans-serif',
							fontSize: '16',
							fontWeight: 'normal',
						}
					},
					legend: {
						icon: "circle",
						top: "0%",
						right: "5%",
						itemWidth: 6,
						itemGap: 20,
						textStyle: {
							color: "#556677",
						},
					},
					tooltip: {
						trigger: "axis",
						axisPointer: {
							label: {
								show: true,
								backgroundColor: "#fff",
								color: "#556677",
								borderColor: "rgba(0,0,0,0)",
								shadowColor: "rgba(0,0,0,0)",
								shadowOffsetY: 0,
							},
							lineStyle: {
								width: 0,
							},
						},
						backgroundColor: "#fff",
						textStyle: {
							color: "#5c6c7c",
						},
						padding: [10, 10],
						extraCssText: "box-shadow: 1px 0 2px 0 rgba(163,163,163,0.5)",
					},
					grid: {
						top: "10%",
						left: "8%",
						right: "10%",
					},
					dataZoom: [{
							// 这个地方是控制下面的滑动条。
							show: true,
							realtime: true,
						},
						{
							type: "inside",
							realtime: true,
							start: 0,
							end: 100,
							xAxisIndex: [0, 1],
						},
					],
					xAxis: [{
						type: "category",
						data: this.dataX1,
						axisLine: {
							lineStyle: {
								color: "#DCE2E8",
							},
						},
						axisTick: {
							show: false,
						},
						axisLabel: {
							textStyle: {
								color: "#556677",
							},
							showMinLabel: true,
							showMaxLabel: true,
							// 默认x轴字体大小
							fontSize: 12,
							// margin:文字到x轴的距离
							margin: 15,
						},
						axisPointer: {
							label: {
								// padding: [11, 5, 7],
								padding: [0, 0, 10, 0],
								margin: 15,
								fontSize: 12,
								backgroundColor: {
									type: "linear",
									x: 0,
									y: 0,
									x2: 0,
									y2: 1,
									colorStops: [{
											offset: 0,
											color: "#fff", // 0% 处的颜色
										},
										{
											offset: 0.86,
											color: "#fff", // 0% 处的颜色
										},
										{
											offset: 0.86,
											color: "#33c0cd", // 0% 处的颜色
										},
										{
											offset: 1,
											color: "#33c0cd", // 100% 处的颜色
										},
									],
									global: false, // 缺省为 false
								},
							},
						},
						boundaryGap: false,
					}, ],
					yAxis: [{
							type: "value",
							axisTick: {
								show: false,
							},
							axisLine: {
								show: true,
								lineStyle: {
									color: "#DCE2E8",
								},
							},
							axisLabel: {
								textStyle: {
									color: "#556677",
								},
							},
							splitLine: {
								show: false,
							},
						},
						{
							type: "value",
							position: "right",
							axisTick: {
								show: false,
							},
							axisLabel: {
								textStyle: {
									color: "#556677",
								},
								formatter: "{value}",
							},
							axisLine: {
								show: true,
								lineStyle: {
									color: "#DCE2E8",
								},
							},
							splitLine: {
								show: false,
							},
						},
					],
					series: [{
							name: "动能曲线(J)",
							type: "line",
							data: this.dataYD1,
							symbolSize: 1,
							symbol: "circle",
							smooth: true,
							yAxisIndex: 0,
							showSymbol: false,
							lineStyle: {
								width: 5,
								color: colorList[0],
							},
							itemStyle: {
								normal: {
									color: colorList[0],
									borderColor: colorList[0],
								},
							},
						},
						{
							name: "速度曲线(m/s)",
							type: "line",
							data: this.dataY1,
							symbolSize: 1,
							symbol: "circle",
							smooth: true,
							yAxisIndex: 1,
							showSymbol: false,
							lineStyle: {
								width: 5,
								color: colorList[1],
							},
							itemStyle: {
								normal: {
									color: colorList[1],
									borderColor: colorList[1],
								},
							},
						},
					],
				};
				that.closechart.setOption(option);
				if (that.closechart) {
					setTimeout(() => {
						that.closechart.resize();
					}, 200)
				}
				window.addEventListener("resize", () => {
					that.closechart.resize();
				});
			},
			echarts(data) {
				if (this.dataForm.DCU) {
					this.$router.push({
						name: "operEchart",
						query: {
							doorDcu: this.dataForm.DCU,
							type: data
						},
					});
				} else {
					return this.$message.error("请选择门控单元门编号");
				}

			},
			//开门曲线修改
			CurveChange(val) {
				if (this.velocityCurveOpen == 1) {
					this.curve64Status = true
					this.getSpeedCurve64(0)
				} else if (this.velocityCurveOpen == 0) {
					this.curve64Status = false
					this.init(0)
				}
				if (this.velocityCurveClose == 1) {
					this.curve64StatusClose = true
					this.getSpeedCurve64(1)
				} else if (this.velocityCurveClose == 0) {
					this.curve64StatusClose = false
					this.init(1)
				}
			},
			getSpeedCurve64(val) {
				let that = this
				this.CurveTimeList = []
				this.CurveTimeListClose = []
				if (this.dataForm.DCU) {
					this.$http.get(`/psc/dcu/speedCurve64?dcuId=` + this.returnDoorId() + '&openClose=' + val).then((
						res) => {
							if (res.data.code == 0 && res.data.data !== null) {
								var speedList = res.data.data
								Object.keys(speedList).forEach((item, index) => {
									var obj = {
										name: that.filterTime(Number(item)),
										currentTime: Number(item),
										id: index,
										obj: speedList[item]
									}
									if (val == 0) {
										this.CurveTimeList.push(obj)
									} else if (val == 1) {
										this.CurveTimeListClose.push(obj)
									}

								})
							}
						});
				} else {
					this.velocityCurveOpen = 0
					this.velocityCurveClose = 0
					return this.$message.error("请选择门控单元门编号");
				}

			},
			CurveTimeChange(val) {
				if (val == 0) {
					var obj = this.CurveTimeList[this.velocityCurveTime].obj
					var CurrentTime = this.CurveTimeList[this.velocityCurveTime].currentTime
					this.getCureSpeed(obj, CurrentTime)
					this.refreshData(this.dataX, this.dataYD, this.dataY, 0);
				} else {
					var obj = this.CurveTimeListClose[this.velocityCurveTime1].obj
					var CurrentTime = this.CurveTimeListClose[this.velocityCurveTime1].currentTime
					this.getCureSpeedClose(obj, CurrentTime)
					this.refreshData(this.dataX1, this.dataYD1, this.dataY1, 1);
				}
			},
			getCureSpeed(obj, CurrentTime) {
				//开门的64条曲线
				this.dataY = [
					0,
					obj.v1.toFixed(4),
					obj.v2.toFixed(4),
					obj.v3.toFixed(4),
					obj.v4.toFixed(4),
					obj.v5.toFixed(4),
					obj.v6.toFixed(4),
					obj.v7.toFixed(4),
					obj.v8.toFixed(4),
					obj.v9.toFixed(4),
					0
				];
				this.dataYD = [
					0,
					obj.ek1.toFixed(4),
					obj.ek2.toFixed(4),
					obj.ek3.toFixed(4),
					obj.ek4.toFixed(4),
					obj.ek5.toFixed(4),
					obj.ek6.toFixed(4),
					obj.ek7.toFixed(4),
					obj.ek8.toFixed(4),
					obj.ek9.toFixed(4),
					0
				];
				// 解析曲线的横坐标
				var x = CurrentTime;
				for (var i = 0; i < 11; i++) {
					if (i == 0) {
						this.dataX[i] = this.filterTime(x)
					} else if (i == 10) {
						//获取第一点数据
						var t0 = obj.t9 - obj.t8
						var t8 = obj.t9 + t0
						this.dataX[i] = this.getnewSeconds(x, t8)
					} else {
						this.dataX[i] = this.getnewSeconds(x, obj["t" + `${i}`])
					}
				}
			},
			getCureSpeedClose(obj, CurrentTime) {
				this.dataY1 = [
					0,
					obj.v1.toFixed(4),
					obj.v2.toFixed(4),
					obj.v3.toFixed(4),
					obj.v4.toFixed(4),
					obj.v5.toFixed(4),
					obj.v6.toFixed(4),
					obj.v7.toFixed(4),
					obj.v8.toFixed(4),
					obj.v9.toFixed(4),
					0
				];
				this.dataYD1 = [
					0,
					obj.ek1.toFixed(4),
					obj.ek2.toFixed(4),
					obj.ek3.toFixed(4),
					obj.ek4.toFixed(4),
					obj.ek5.toFixed(4),
					obj.ek6.toFixed(4),
					obj.ek7.toFixed(4),
					obj.ek8.toFixed(4),
					obj.ek9.toFixed(4),
					0
				];
				// 解析曲线的横坐标
				var x = CurrentTime;
				for (var i = 0; i < 11; i++) {
					if (i == 0) {
						this.dataX1[i] = this.filterTime(x)
					} else if (i == 10) {
						//获取第一点数据
						var t0 = obj.t9 - obj.t8
						var t8 = obj.t9 + t0
						this.dataX1[i] = this.getnewSeconds(x, t8)
					} else {
						this.dataX1[i] = this.getnewSeconds(x, obj["t" + `${i}`])
					}
				}
			},
		},
	};
</script>

<style scoped>
	.bg {
		background-color: #fff;
		border-radius: 10px;
		display: flex;
		align-items: center;
		/* height: 7.6vh; */
		/* min-height: 76px; */
		/* line-height: 7.6vh; */
		padding: 0.8vw 1.8vw;
	}

	.bg>>>.el-form--inline .el-form-item__content,
	.el-form--inline .el-form-item {
		vertical-align: middle !important;
	}

	.bg>>>.el-form-item {
		margin-bottom: 0;
	}

	.bg1 {
		background-color: #fff;
		border-radius: 10px;
		display: flex;
		align-items: center;
		/* height: 121.7vh; */
		/* height: 79vh; */
		/* min-height: 724px; */
		padding: 1.6vh 1.5vw;
		margin-top: 10px;
	}

	.homeTuTxt {
		width: 16px;
		font-size: 18px;
		font-weight: 400;
		word-wrap: break-word;
		word-break: normal;
		line-height: 40px;
		color: rgba(0, 65, 135, 1);
	}

	.bg1 .el-col {
		height: 100%;
	}

	.baseHeader {
		margin: 0;
		font-size: 18px;
		font-weight: 500;
		color: rgba(46, 48, 51, 1);
	}

	.baseInfo {
		display: flex;
		width: 100%;
		/* height: 78.1vh; */
		/* height: 50vh; */
		/* min-height: 484px; */
		padding: 10px 2.1vw;
		background: rgba(0, 123, 255, 0.1);
		border-radius: 10px;
		align-items: center;
		margin-top: 1.3vh;
	}

	.baseInfozd {
		/* height: 34.3vh; */
		/* height: 21vh; */
		/* min-height: 204px; */
	}

	.baseInfoContent {
		width: 100%;
		height: 100%;
		padding-left: 1.9vw;
	}

	.baseInfoContent>>>.el-row {
		display: flex;
		/* justify-content: space-between; */
	}

	.baseInfoContent>>>.el-input__inner {
		height: 100%;
		text-align: center;
	}

	.baseInfoContent>>>.el-form--inline .el-form-item__content,
	.el-form--inline .el-form-item {
		vertical-align: middle !important;
	}

	.baseInfoContent>>>.el-form-item {
		margin-bottom: 0;
	}

	.baseInfoContent>>>.el-form {
		height: 100%;
		display: flex;
		flex-direction: column;
		justify-content: space-evenly;
	}

	.baseInfo1 {
		width: 50%;
		display: flex;
		justify-content: flex-start;
	}

	.baseInfo1>>>.el-form-item__label {
		/* width: 11vw; */
		width: 150px;
		font-size: 14px;
		font-weight: 400;
		color: rgba(46, 48, 51, 1);
	}

	.baseInfo2 {
		padding-left: 8vw;
	}

	.baseInfo2 div {
		width: 7.8vw;
		display: flex;
		justify-content: center;
	}

	.baseInfoBtn>>>.el-button--primary:focus,
	.baseInfoBtn>>>.el-button--primary:hover {
		border-radius: 10px;

		background: rgba(25, 77, 138, 1) !important;
	}

	.baseInfoBtn>>>.el-button--primary {
		padding: 10px !important;
		border-radius: 10px;
		background: rgba(25, 77, 138, 1) !important;
		font-size: 16px;
		font-weight: 400;
		color: rgba(255, 255, 255, 1);
	}

	.baseInfoBtnAll {
		/* width: 95%; */
		width: 100%;
		justify-content: flex-end;
	}

	.danwei {
		font-size: 14px;
		font-weight: 400;
		color: rgba(46, 48, 51, 1);
		display: flex;
		align-items: center;
	}

	.baseInfoBtnRight {
		/* position: absolute;
		right: 1.8vw;
		top: 2vh;
		height: 96%;
		width: 7.8vw; */
	}

	.baseInfoBtnRight .baseInfoBtn {
		/* display: flex;
		flex-direction: column;
		height: 100%;
		justify-content: space-evenly; */
	}

	.baseInfoBtnRight>>>.baseInfoBtn1,
	.PEDCBtn>>>.baseInfoBtn1 {
		background: rgba(42, 130, 228, 1) !important;
		border-color: rgba(42, 130, 228, 1) !important;
	}

	.baseInfoBtnRight>>>.baseInfoBtn1:focus,
	.baseInfoBtnRight>>>.baseInfoBtn1:hover,
	.PEDCBtn>>>.baseInfoBtn1:focus,
	.PEDCBtn>>>.baseInfoBtn1:hover {
		background: rgba(42, 130, 228, 0.8) !important;
		border-color: rgba(42, 130, 228, 1) !important;
	}

	.baseInfoBtnRight>>>.baseInfoBtn2,
	.PEDCBtn>>>.baseInfoBtn2 {
		background: rgba(255, 87, 51, 1) !important;
		border-color: rgba(255, 87, 51, 1) !important;
	}

	.baseInfoBtnRight>>>.baseInfoBtn2:focus,
	.baseInfoBtnRight>>>.baseInfoBtn2:hover,
	.PEDCBtn>>>.baseInfoBtn2:focus,
	.PEDCBtn>>>.baseInfoBtn2:hover {
		background: rgba(255, 87, 51, 1) !important;
		border-color: rgba(255, 87, 51, 1) !important;
	}

	.baseInfoBtnRight>>>.baseInfoBtn3 {
		background: rgba(67, 207, 124, 1) !important;
		border-color: rgba(67, 207, 124, 1) !important;
	}

	.baseInfoBtnRight>>>.baseInfoBtn3:focus,
	.baseInfoBtnRight>>>.baseInfoBtn3:hover {
		background: rgba(67, 207, 124, 0.8) !important;
		border-color: rgba(67, 207, 124, 1) !important;
	}

	.baseInfoBtnRight>>>.baseInfoBtn4 {
		background: rgba(56, 56, 56, 1) !important;
		border-color: rgba(56, 56, 56, 1) !important;
	}

	.baseInfoBtnRight>>>.baseInfoBtn4:focus,
	.baseInfoBtnRight>>>.baseInfoBtn4:hover {
		background: rgba(56, 56, 56, 1) !important;
		border-color: rgba(56, 56, 56, 1) !important;
	}

	.baseInfoBtnRight>>>.baseInfoBtn5 {
		background: rgba(255, 141, 26, 1) !important;
		border-color: rgba(255, 141, 26, 1) !important;
	}

	.baseInfoBtnRight>>>.baseInfoBtn5:focus,
	.baseInfoBtnRight>>>.baseInfoBtn5:hover {
		background: rgba(255, 141, 26, 0.8) !important;
		border-color: rgba(255, 141, 26, 1) !important;
	}

	.baseInfoBtnRight>>>.el-button {
		/* padding: 10px !important; */
	}

	.bg2 {
		background-color: #fff;
		border-radius: 10px;
		padding: 2.1vh 1.5vw;
		margin-top: 10px;
		height: 40.1vh;
		min-height: 295px;
	}

	.bg3 {
		height: 24.5vh;
	}

	.bg3>>>.el-row {
		height: 100%;
	}

	.PEDCInfo {
		padding: 2vh 2.1vw 0;
		height: calc(100% - 23px);
		display: flex;
		align-items: center;
	}

	.PEDCBtn {
		display: flex;
	}

	.baseInfoEcharts {
		width: 100%;
		height: 100%;
	}

	.baseInfo1 .company {
		height: 2.7vh;
		line-height: 2.7vh;
		margin-top: 0.8vh;
		font-size: 14px;
	}

	.leftColor>>>.el-input__inner {
		color: #fff !important;
	}

	.operIndexDiv>>>.el-form-item__label {
		text-align: left;
	}

	.cure {
		width: 49.5%;
		margin-right: 1%;
		height: 40.1vh;
		margin-top: 10px;
		padding: 2.1vh 1.5vw;
		border-radius: 10px;
		background-color: #fff;
	}

	.cure1 {
		margin-right: 0;
	}

	.chartbase {
		display: contents;
	}

	.chartbase>>>.el-select:first-child {
		width: 110px;
	}

	.baseInfo1>>>.el-input-number__decrease,
	.baseInfo1>>>.el-input-number__increase {
		height: 94%;
		margin-top: 1%;
	}

	.baseInfo1>>>.el-input-number .el-input {
		height: 100%;
	}

	@media screen and (max-width:1500px) {
		.chartbase {
			display: block;
			width: 100%;
			margin-top: 10px;
		}
	}
</style>
